home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / dancing_princess.swf / scripts / frame_4 / DoAction.as
Text File  |  2007-09-26  |  8KB  |  292 lines

  1. function sd()
  2. {
  3.    ggame_dress1_lc = new LocalConnection();
  4.    ggame_dress1_lc.send("lc_name","methodToExecute",buy_str);
  5. }
  6. stop();
  7. var m_name = ["one","up","down","shoes","head","eye","neck","ear","bag","foot"];
  8. var one_dname = "";
  9. var up_dname = "";
  10. var down_dname = "";
  11. var shoes_dname = "";
  12. var head_dname = "";
  13. var eye_dname = "";
  14. var neck_dname = "";
  15. var ear_dname = "";
  16. var bag_dname = "";
  17. var foot_dname = "";
  18. var highest_depth = 0;
  19. make_drag = function()
  20. {
  21.    var _loc4_ = 0;
  22.    while(_loc4_ < 12)
  23.    {
  24.       var _loc3_ = 0;
  25.       while(_loc3_ < m_name.length)
  26.       {
  27.          _root[m_name[_loc3_] + "_" + _loc4_].odepth = _root[m_name[_loc3_] + "_" + _loc4_].getDepth();
  28.          _root[m_name[_loc3_] + "_" + _loc4_].ox = _root[m_name[_loc3_] + "_" + _loc4_]._x;
  29.          _root[m_name[_loc3_] + "_" + _loc4_].oy = _root[m_name[_loc3_] + "_" + _loc4_]._y;
  30.          _root[m_name[_loc3_] + "_" + _loc4_].onPress = function()
  31.          {
  32.             highest_depth++;
  33.             this.swapDepths(highest_depth);
  34.             this.startDrag();
  35.          };
  36.          _root[m_name[_loc3_] + "_" + _loc4_].onRelease = function()
  37.          {
  38.             if(this._droptarget == "/game_ava/hidden_area")
  39.             {
  40.                drop(this._name);
  41.             }
  42.             else
  43.             {
  44.                move_f(this._name,this.ox,this.oy);
  45.             }
  46.             this.stopDrag();
  47.          };
  48.          _root[m_name[_loc3_] + "_" + _loc4_].onReleaseOutside = function()
  49.          {
  50.             if(this._droptarget == "/game_ava/hidden_area")
  51.             {
  52.                drop(this._name);
  53.             }
  54.             else
  55.             {
  56.                move_f(this._name,this.ox,this.oy);
  57.             }
  58.             this.stopDrag();
  59.          };
  60.          _loc3_ = _loc3_ + 1;
  61.       }
  62.       _loc4_ = _loc4_ + 1;
  63.    }
  64. };
  65. drop = function(drop_name)
  66. {
  67.    so2.start(0,1);
  68.    var _loc2_ = drop_name.indexOf("_");
  69.    _root[drop_name]._visible = false;
  70.    _root.game_ava[drop_name.slice(0,_loc2_) + "_m"].gotoAndStop(parseInt(drop_name.slice(_loc2_ + 1,_loc2_ + 3)) + 2);
  71.    if(drop_name.slice(0,_loc2_) == "up")
  72.    {
  73.       game_ava.underwear_up._visible = false;
  74.       _root[one_dname]._visible = true;
  75.       _root.game_ava.one_m.gotoAndStop(1);
  76.       move_f(one_dname,_root[one_dname].ox,_root[one_dname].oy);
  77.       if(one_dname != "")
  78.       {
  79.          game_ava.underwear_down._visible = true;
  80.       }
  81.       one_dname = "";
  82.    }
  83.    else if(drop_name.slice(0,_loc2_) == "down")
  84.    {
  85.       game_ava.underwear_down._visible = false;
  86.       _root[one_dname]._visible = true;
  87.       _root.game_ava.one_m.gotoAndStop(1);
  88.       move_f(one_dname,_root[one_dname].ox,_root[one_dname].oy);
  89.       if(one_dname != "")
  90.       {
  91.          game_ava.underwear_up._visible = true;
  92.       }
  93.       one_dname = "";
  94.    }
  95.    else if(drop_name.slice(0,_loc2_) == "one")
  96.    {
  97.       game_ava.underwear_up._visible = false;
  98.       game_ava.underwear_down._visible = false;
  99.       _root[up_dname]._visible = true;
  100.       _root.game_ava.up_m.gotoAndStop(1);
  101.       move_f(up_dname,_root[up_dname].ox,_root[up_dname].oy);
  102.       _root[down_dname]._visible = true;
  103.       _root.game_ava.down_m.gotoAndStop(1);
  104.       move_f(down_dname,_root[down_dname].ox,_root[down_dname].oy);
  105.       up_dname = "";
  106.       down_dname = "";
  107.    }
  108.    _root[_root[drop_name.slice(0,_loc2_) + "_dname"]]._visible = true;
  109.    move_f(_root[drop_name.slice(0,_loc2_) + "_dname"],_root[_root[drop_name.slice(0,_loc2_) + "_dname"]].ox,_root[_root[drop_name.slice(0,_loc2_) + "_dname"]].oy);
  110.    _root[drop_name.slice(0,_loc2_) + "_dname"] = drop_name;
  111. };
  112. move_f = function(dr_name, xx, yy)
  113. {
  114.    _root[dr_name].swapDepths(_root[dr_name].odepth);
  115.    var _loc4_ = new mx.transitions.Tween(_root[dr_name],"_x",mx.transitions.easing.Back.easeOut,_root[dr_name]._x,xx,10);
  116.    var _loc3_ = new mx.transitions.Tween(_root[dr_name],"_y",mx.transitions.easing.Back.easeOut,_root[dr_name]._y,yy,10);
  117. };
  118. ava_default = function()
  119. {
  120.    var _loc2_ = 0;
  121.    while(_loc2_ < m_name.length)
  122.    {
  123.       _root[_root[m_name[_loc2_] + "_dname"]]._visible = true;
  124.       _root.game_ava[m_name[_loc2_] + "_m"].gotoAndStop(1);
  125.       move_f(_root[m_name[_loc2_] + "_dname"],_root[_root[m_name[_loc2_] + "_dname"]].ox,_root[_root[m_name[_loc2_] + "_dname"]].oy);
  126.       _root[m_name[_loc2_] + "_dname"] = "";
  127.       _loc2_ = _loc2_ + 1;
  128.    }
  129.    game_ava.underwear_up._visible = true;
  130.    game_ava.underwear_down._visible = true;
  131. };
  132. game_play_bt.onRollOver = function()
  133. {
  134.    so1.start(0,1);
  135.    this._xscale = 105;
  136.    this._yscale = 105;
  137. };
  138. game_play_bt.onRollOut = function()
  139. {
  140.    this._xscale = 100;
  141.    this._yscale = 100;
  142. };
  143. game_play_bt.onPress = function()
  144. {
  145.    so1.start(0,1);
  146.    this.gotoAndStop(2);
  147. };
  148. game_play_bt.onRelease = function()
  149. {
  150.    this.gotoAndStop(1);
  151.    gotoAndStop(5);
  152. };
  153. game_play_bt.onReleaseOutside = function()
  154. {
  155.    this.gotoAndStop(1);
  156.    gotoAndStop(5);
  157. };
  158. ava_default_bt.onRollOver = function()
  159. {
  160.    so1.start(0,1);
  161.    this._xscale = 105;
  162.    this._yscale = 105;
  163. };
  164. ava_default_bt.onRollOut = function()
  165. {
  166.    this._xscale = 100;
  167.    this._yscale = 100;
  168. };
  169. ava_default_bt.onPress = function()
  170. {
  171.    so1.start(0,1);
  172.    this.gotoAndStop(2);
  173. };
  174. ava_default_bt.onRelease = function()
  175. {
  176.    this.gotoAndStop(1);
  177.    ava_default();
  178. };
  179. ava_default_bt.onReleaseOutside = function()
  180. {
  181.    this.gotoAndStop(1);
  182.    ava_default();
  183. };
  184. make_drag();
  185. var buy_str = "";
  186. var game_name = "G270030";
  187. var game_price = 3500;
  188. var buy_2 = ["G260048","G260049"];
  189. var buy_3 = ["G250203","G250204","G250205","G250206","G250207","G250208","G250209"];
  190. var buy_4 = ["G240255","G240256","G240257","G240258","G240259","G240260","G240261"];
  191. var buy_5 = ["G230261","G230262","G230263","G230264","G230265","G230266","G230267"];
  192. var buy_6 = ["G220146","G220147","G220148","G220149"];
  193. var buy_7 = ["G210079","G210080","G210081"];
  194. var buy_8 = ["G200046"];
  195. var buy_9 = ["G190053","G190054"];
  196. var buy_11 = ["G170076","G170078","G170075","G170077"];
  197. buy_item = function()
  198. {
  199.    foot_m = game_ava.foot_m._currentframe;
  200.    shoes_m = game_ava.shoes_m._currentframe;
  201.    down_m = game_ava.down_m._currentframe;
  202.    up_m = game_ava.up_m._currentframe;
  203.    one_m = game_ava.one_m._currentframe;
  204.    bag_m = game_ava.bag_m._currentframe;
  205.    neck_m = game_ava.neck_m._currentframe;
  206.    ear_m = game_ava.ear_m._currentframe;
  207.    eye_m = game_ava.eye_m._currentframe;
  208.    head_m = game_ava.head_m._currentframe;
  209.    var _loc4_ = new Array();
  210.    var _loc2_ = 0;
  211.    while(_loc2_ < avaStr.length / 7 - 1)
  212.    {
  213.       var _loc3_ = avaStr.slice((_loc2_ + 1) * 7,(_loc2_ + 1) * 7 + 7);
  214.       if((_loc3_.slice(1,3) < 17 || _loc3_.slice(1,3) > 32) && _loc3_.slice(1,3) != 13)
  215.       {
  216.          _loc4_.push(avaStr.slice((_loc2_ + 1) * 7,(_loc2_ + 1) * 7 + 7));
  217.       }
  218.       _loc2_ = _loc2_ + 1;
  219.    }
  220.    var _loc5_ = _loc4_.join("");
  221.    buy_str = game_name;
  222.    if(foot_m != 1)
  223.    {
  224.       buy_str += buy_2[foot_m - 2];
  225.    }
  226.    if(shoes_m != 1)
  227.    {
  228.       buy_str += buy_3[shoes_m - 2];
  229.    }
  230.    if(down_m != 1)
  231.    {
  232.       buy_str += buy_4[down_m - 1];
  233.    }
  234.    else if(one_m == 1 && down_m == 1)
  235.    {
  236.       buy_str += buy_4[0];
  237.    }
  238.    if(up_m != 1)
  239.    {
  240.       buy_str += buy_5[up_m - 1];
  241.    }
  242.    else if(one_m == 1 && up_m == 1)
  243.    {
  244.       buy_str += buy_5[0];
  245.    }
  246.    if(one_m != 1)
  247.    {
  248.       buy_str += buy_6[one_m - 2];
  249.    }
  250.    if(bag_m != 1)
  251.    {
  252.       buy_str += buy_7[bag_m - 2];
  253.    }
  254.    if(neck_m != 1)
  255.    {
  256.       buy_str += buy_8[neck_m - 2];
  257.    }
  258.    if(ear_m != 1)
  259.    {
  260.       buy_str += buy_9[ear_m - 2];
  261.    }
  262.    if(eye_m != 1)
  263.    {
  264.       buy_str += buy_10[eye_m - 2];
  265.    }
  266.    if(head_m != 1)
  267.    {
  268.       buy_str += buy_11[head_m - 2];
  269.    }
  270.    buy_str = avaStr.slice(0,2) + "1" + avaStr.slice(3,7) + _loc5_ + buy_str;
  271.    trace(buy_str);
  272.    getURL("JavaScript:GoGAva(\'" + _root.buy_str + "\',\'" + _root.game_price + "\')","");
  273. };
  274. buy_bt.onRollOver = function()
  275. {
  276.    this.buy_bt_rollover.gotoAndStop(2);
  277. };
  278. buy_bt.onRollOut = function()
  279. {
  280.    this.buy_bt_rollover.gotoAndStop(1);
  281. };
  282. buy_bt.onPress = function()
  283. {
  284.    this.gotoAndStop(2);
  285. };
  286. buy_bt.onRelease = buy_bt.onReleaseOutside = function()
  287. {
  288.    this.buy_bt_rollover.gotoAndStop(1);
  289.    this.gotoAndStop(1);
  290.    buy_item();
  291. };
  292.